import api from './index'
import { axios } from '../utils/request'

// 查询用户列表
export function listUser (parameter) {
  return axios({
    url: api.listUser,
    method: 'get',
    data: parameter
  })
}

// 查询用户详细
export function getUser (userId) {
  return axios({
    url: api.getSysUser + userId,
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

// 新增用户
export function addUser (parameter) {
  return axios({
    url: api.addUser,
    method: 'post',
    data: parameter
  })
}

// 修改用户
export function updateUser (data) {
  return axios({
    url: api.updateUser,
    method: 'put',
    data: data
  })
}

// 删除用户
export function delUser (data) {
  return axios({
    url: api.deleteUser,
    method: 'delete',
    data: data
  })
}

// 导出用户
export function exportUser (query) {
  return axios({
    url: api.exportUser,
    method: 'get',
    data: query
  })
}